﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace myBoard.Framework
{
	/// <summary>
	/// Interaction logic for ConfigButton.xaml
	/// </summary>
	public partial class ConfigButton
	{
        public event EventHandler Click;


        public SolidColorBrush TextColor
        {
            get { return (SolidColorBrush)GetValue(TextColorProperty); }
            set { SetValue(TextColorProperty, value); }
        }

        public static readonly DependencyProperty TextColorProperty =
            DependencyProperty.Register("TextColor", typeof(SolidColorBrush), typeof(ConfigButton), new UIPropertyMetadata(TextColorChanged));

        private static void TextColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ConfigButton configButton = d as ConfigButton;
            configButton._i.Foreground = e.NewValue as SolidColorBrush;
        }

        public SolidColorBrush EllipseColor
        {
            get { return (SolidColorBrush)GetValue(EllipseColorProperty); }
            set { SetValue(EllipseColorProperty, value); }
        }

        public static readonly DependencyProperty EllipseColorProperty =
            DependencyProperty.Register("EllipseColor", typeof(SolidColorBrush), typeof(ConfigButton), new UIPropertyMetadata(EllipseColorChanged));

        private static void EllipseColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ConfigButton configButton = d as ConfigButton;
            configButton._ellipse.Fill = e.NewValue as SolidColorBrush;
        } 

		public ConfigButton()
		{
			this.InitializeComponent();
            _button.Click += new RoutedEventHandler(_button_Click);
		}

        void _button_Click(object sender, RoutedEventArgs e)
        {
            if (Click != null)
                Click(sender, e);
        }
	}
}